package com.decent.controller;

import com.decent.entity.Banner;
import com.decent.entity.common.Message;
import com.decent.service.BannerService;
import com.decent.enums.MessageEnum;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;

/**
 * @Author decent
 * @Create 2021/4/7 - 15:51
 * @Description
 */
@RestController
public class BannerController {

    @Resource
    private BannerService bannerService;

    /**
     * banner图
     * @return Message
     */
    @RequestMapping("/banner/home")
    public Message listHomeBanner() {
        List<Banner> images = bannerService.listBanner();
        return new Message(MessageEnum.GENERAL_REQUEST_SUCCESS, images);
    }

}
